@extends('admin.layout.layout')
@section('title')
    <title>北京仁爱慈善基金CMS管理系统 >> 项目内容列表</title>
@endsection
@section('con')
    <div class="row">
    @if (session('success'))
	    
	    <div id="successInfo" class="alert alert-success alert-dismissable col-xs-4 col-xs-offset-3" style="position: absolute;top: 70px;">
            {{ session('success') }}
        </div>     
	@endif
	@if (session('error'))
	    <div id="errorInfo" class="alert alert-danger alert-dismissable col-xs-4 col-xs-offset-3" style="position: absolute;top: 70px;">
	    <div id="errorInfo" class="alert alert-success alert-dismissable col-xs-4 col-xs-offset-3" style="position: absolute;top: 70px;">
            {{ session('error') }}
        </div>     
	@endif
        <div class="col-lg-12">
            <h1 class="page-header">项目内容列表</h1>
        </div>
        <!-- /.col-lg-12 -->
    </div>
    <div class="row">
                <div class="col-sm-12">
                    <div class="panel panel-default">
                        <div class="panel-heading">
                           
                        </div>
                        <!-- /.panel-heading -->
                        <div class="panel-body">
                            <!-- Nav tabs -->
                            <ul class="nav nav-tabs">
                            @foreach($types as $k => $v)
                                <li class="active"><a href="{{url('/admin/pcontent/dss',['pid'=>$v->id])}}" >{{$v->pname}}</a>
                                </li>
                            @endforeach
                            </ul>

                            <!-- Tab panes -->
                            <div class="tab-content">
                                <div class="tab-pane fade in active" id="home">
                                    
                                    <div class="row"> 
                                     <div class="col-lg-12"> 
                                      <div class="panel panel-default"> 
                                      
                                       <!-- /.panel-heading --> 
                                       <div class="panel-body"> 
                                        <div class="dataTable_wrapper"> 
                                         <div id="dataTables-example_wrapper" class="dataTables_wrapper form-inline dt-bootstrap no-footer">
                                          <div class="row">
                                           <div class="col-sm-6">
                                           <form action="{{asset('/admin/pcontent/index')}}" method="get">
                                            <div class="dataTables_length" id="dataTables-example_length">
                                             <label>每页显示<select aria-controls="dataTables-example" class="form-control input-sm" name="strip">
                                             <option value="10" @if(!empty($pages['strip']) && $pages['strip'] == '10') selected @endif>10</option>
                                             <option value="25" @if(!empty($pages['strip']) && $pages['strip'] == '25') selected @endif>25</option>
                                             <option value="50" @if(!empty($pages['strip']) && $pages['strip'] == '50') selected @endif>50</option>
                                             <option value="100" @if(!empty($pages['strip']) && $pages['strip'] == '100') selected @endif>100</option>
                                             </select>条</label>
                                            </div>
                                           </div>
                                           <div class="col-sm-6">
                                            <div id="dataTables-example_filter" class="dataTables_filter">
                                             <label>查询:<input type="search" class="form-control input-sm" placeholder="" aria-controls="dataTables-example"  name="keywords"/ value="{{$pages['keywords'] or ''}}"></label>
                                             <button type="submit" class="btn btn-outline btn-primary">搜索</button>
                                            </div>
                                           </div>
                                           </form>
                                          </div>
                                          <div class="row">
                                           <div class="col-sm-12">
                                            <table class="table table-striped table-bordered table-hover dataTable no-footer" id="dataTables-example" role="grid" aria-describedby="dataTables-example_info"> 
                                             <thead> 
                                              <tr role="row">
                                               <th class="sorting_desc" tabindex="0" aria-controls="dataTables-example" rowspan="1" colspan="1" aria-label="Rendering engine: activate to sort column ascending" aria-sort="descending" >ID</th>
                                               <th class="sorting_desc" tabindex="0" aria-controls="dataTables-example" rowspan="1" colspan="1" aria-label="Rendering engine: activate to sort column ascending" aria-sort="descending" >项目内容名称</th>
                                               <th class="sorting" tabindex="0" aria-controls="dataTables-example" rowspan="1" colspan="1" aria-label="Browser: activate to sort column ascending" >项目内容概述</th>
                                               <th class="sorting" tabindex="0" aria-controls="dataTables-example" rowspan="1" colspan="1" aria-label="Platform(s): activate to sort column ascending">项目主图</th>
                                               <th class="sorting" tabindex="0" aria-controls="dataTables-example" rowspan="1" colspan="1" aria-label="Engine version: activate to sort column ascending">发表时间</th>
                                               <th class="sorting" tabindex="0" aria-controls="dataTables-example" rowspan="1" colspan="1" aria-label="Engine version: activate to sort column ascending">内容来源</th>
                                               <th class="sorting" tabindex="0" aria-controls="dataTables-example" rowspan="1" colspan="1" aria-label="Engine version: activate to sort column ascending">发表人</th>
                                               <th class="sorting" tabindex="0" aria-controls="dataTables-example" rowspan="1" colspan="1" aria-label="Engine version: activate to sort column ascending">显示状态</th>
                                               <th class="sorting" tabindex="0" aria-controls="dataTables-example" rowspan="1" colspan="1" aria-label="CSS grade: activate to sort column ascending" style="width: 70px;" >操作</th>
                                              </tr> 
                                             </thead> 
                                             <tbody> 
                                             @foreach($datas as $k => $v)
                                              <tr class="gradeA odd ptype" role="row"> 
                                               <td class="sorting_1">{{$v->id}}</td> 
                                               <td class="center">{{$v->title}}</td>  
                                               <td class="center">{{$v->intro}}</td> 
                                               <td class="center"><img src="{{asset($v->pic)}}" alt="" width="100px"></td> 
                                               <td class="center">{{date('Y-m-d H:i',$v->time)}}</td>
                                               <td class="center">{{$v->author}}</td> 
                                               <td class="center">{{$v->pauthor}}</td> 
                                               <td class="center">{{$status[$v->status]}}</td> 
                                               <td class="center">
                                               <div class="row">
                                                <div class="col-sm-12 " style="line-height:30px;text-align:center;">  
                                                  <a href="{{url('/admin/pcontent/info',['id'=>$v->id])}}"><button type="button" class="btn btn-info btn-xs">查看</button></a>            
                                                  <a href="{{url('/admin/pcontent/del',['id'=>$v->id])}}"><button type="button" class="btn btn-danger btn-xs del-p">删除</button></a>
                                                  <a href="{{url('/admin/pcontent/edit',['id'=>$v->id])}}"><button type="button" class="btn btn-warning btn-xs">修改</button></a>      
                                                </div>
                                               </div>
                                               </td> 
                                              </tr>
                                              @endforeach
                                             </tbody> 
                                            </table>
                                           </div>
                                          </div>
                                         <div class="row">
                                            <div class="col-sm-6">
                                               {!! $datas->appends($pages)->render() !!}
                                            </div>
                                         </div>
                                         </div> 
                                        
                                        <!-- /.table-responsive --> 
                                       </div> 
                                       <!-- /.panel-body --> 
                                      </div> 
                                      <!-- /.panel --> 
                                     </div> 
                                     <!-- /.col-lg-12 --> 
                                    </div>
                                </div>
                                
                            </div>
                        </div>
                        <!-- /.panel-body -->
                    </div>
                    <!-- /.panel -->
                </div>
              
            </div>
 
@endsection
@section('js')
	<script>
		// 限制时间
	  setTimeout(function(){
	  	$('#successInfo').hide(1000);
	  	$('#errorInfo').hide(1000);
	  },2000);
  </script>
@endsection